package com.xingshentech.ugv.operate.module.app.log;

import android.content.Context;

import com.blankj.utilcode.util.LogUtils;
import com.xstech.library.app.AppManager;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class XsLog {
    private SimpleDateFormat sd_date = new SimpleDateFormat("yyyy-MM-dd");
    private SimpleDateFormat sd_time = new SimpleDateFormat("HH:mm:ss");
    private static Context context;

    public static XsLog log;

    public static XsLog getInstance(Context con) {
        context = con;
        if (log == null) {
            log = new XsLog();
        }
        return log;
    }

    public static XsLog getInstance() {
        context = AppManager.getAppManager().currentActivity();

        if (log == null) {
            log = new XsLog();
        }
        return log;
    }


    private XsLog() {
    }


    public void save(String message) {
        LogUtils.file(message);
    }

    /**
     * 获取当日时间戳
     *
     * @return
     */
    private Long dayTimeInMillis() {
        Calendar calendar = Calendar.getInstance();// 获取当前日期
        calendar.set(Calendar.HOUR_OF_DAY, 0);
        calendar.set(Calendar.MINUTE, 0);
        calendar.set(Calendar.SECOND, 0);
        Long time = calendar.getTimeInMillis();
        return time;
    }

}